﻿<Window x:Class="PrestoDashboard.Windows.CustomVariableGroupSelectorView"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:ff="clr-namespace:FunctionalFun.UI.Behaviours;assembly=PrestoCommon"
        xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
        xmlns:galaSoft="clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.Extras.WPF4"
        WindowStartupLocation="CenterScreen"
        Background="#FF595959"
        ResizeMode="NoResize"
        FocusManager.FocusedElement="{Binding ElementName=CustomVariableGroupsList}"
        Title="CustomVariableGroupSelectorView" Height="400" Width="300">        
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="40"/>
        </Grid.RowDefinitions>

        <DockPanel Grid.Row="0">
            <Label DockPanel.Dock="Top" Style="{StaticResource StandardLabel}" Content="Custom Variable Groups" HorizontalAlignment="Center"/>
            <ListBox DockPanel.Dock="Bottom" ItemsSource="{Binding CustomVariableGroups}" DisplayMemberPath="Name"                     
                     ff:MultiSelectorBehaviours.SynchronizedSelectedItems="{Binding SelectedCustomVariableGroups}"
                     SelectionMode="Extended" Height="auto" Name="CustomVariableGroupsList">
                <i:Interaction.Triggers>
                    <i:EventTrigger EventName="MouseDoubleClick">
                        <galaSoft:EventToCommand Command="{Binding AddCommand, Mode=OneWay}"/>
                    </i:EventTrigger>
                </i:Interaction.Triggers>
            </ListBox>
        </DockPanel>

        <StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Center">
            <Button Style="{StaticResource StandardButton}" Content="Add" Command="{Binding AddCommand}" />
            <Button Style="{StaticResource StandardButton}" Content="Cancel" Command="{Binding CancelCommand}" />
            <Button Style="{StaticResource StandardButton}" Content="Set" Command="{Binding SetCommand}" ToolTip="Select existing groups" />
        </StackPanel>

    </Grid>
</Window>
